package cn.edu.ctbu.aop.aspect;

import cn.edu.ctbu.aop.util.Result;
import cn.edu.ctbu.aop.util.ResultUtil;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionHandle {
    @ExceptionHandler(value = Exception.class)
    public Result handle(Exception e){
        return ResultUtil.error(-999, e.getMessage());
    }
}